package pers.mobian.springseventh;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.function.Supplier;

/**
 * @Date 2021/7/18 16:59
 * @Created mobian
 * @Description
 */
public class MainTest2 {
	public static void main(String[] args) {

		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
		context.registerBean(MoBian.class, new Supplier<MoBian>() {
			@Override
			public MoBian get() {
				return new MoBian();
			}
		});

		context.refresh();
		System.out.println(context.getBean("moBian"));
	}
}
